﻿using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using DB;
public class ExzamEdit : IExzamEdit
{
    public bool singleAdd(System.Collections.Hashtable ht)
    {
        DataAccess da = new DataAccess();
        string courseid = (string)ht["courseid"];
        string exzamname = (string)ht["exzamname"];
        string starttime = (string)ht["starttime"];
        string endtime = (string)ht["endtime"];
        string exzamplace = (string)ht["exzamplace"];
        string exzamtype = (string)ht["exzamtype"];
        string sql_str = "exec exzam_singleAdd "
            + courseid + ","
            + "'" + exzamname + "',"
            + "'" + starttime + "',"
            + "'" + endtime + "',"
            + "'" + exzamplace + "',"
            + exzamtype;
        da.RunSql(sql_str);
        return true;
    }

    public void singleEdit()
    {
        throw new NotImplementedException();
    }

    public void finalEdit()
    {
        throw new NotImplementedException();
    }
    public bool singleEdit(System.Collections.Hashtable ht)
    {
        DataAccess da = new DataAccess();
        string exzamid = (string)ht["exzamid"];
        string name = (string)ht["name"];
        string place = (string)ht["place"];
        string starttime = (string)ht["starttime"];
        string endtime = (string)ht["endtime"];
        string typeid = (string)ht["typeid"];
        string exzamweight = (string)ht["exzamweight"];
        exzamweight = exzamweight == "" ? "0" : exzamweight;
        string sql_str = "exec exzam_singleEdit "
            + exzamid + ","
            + "'" + name + "',"
            + "'" + place + "',"
            + "'" + starttime + "',"
            + "'" + endtime + "',"
            + "'" + typeid + "',"
            + exzamweight;
        da.RunSql(sql_str);
        return true;
    }

}
